<?php

include_once($cfgPaths['lib'].'cms/type/cmsEditType.o.inc.php');

class cmsEditShortTextType extends cmsEditType {

 function registerFields () {
   $map[] = $this->name.'autobreak';
   $map[] = $this->name.'text';
   $this->map = &$map;
 }

 function render_html () {
  $fu = 'zaehle(this,this.form.'.$this->name.'_anzahl,65535)';
  $html  = '<div class="xicstypeplugin">'."\n";
  $html .= '    <h3>'.$this->descr.':</h3>'.$this->showFields()."\n";
  $html .= '    <div class="xicstypetools"><input type="checkbox" name="'.$this->name.'autobreak" value="Y"';
  if ($this->getValue($this->name.'autobreak')=='Y')
  {
        $html .= ' checked="checked"';
  }
  $html .= ' />Zeilenumbr&uuml;che anzeigen &nbsp;&nbsp;'
        .  '</div>'."\n";
  $html .= '              <textarea tabindex="'.$this->sender->getNextTabindex($this->name.'text').'" name="'.$this->name.'text" cols="60" rows="7" onfocus="'.$fu.'" onclick="'.$fu.'" onchange="'.$fu.'" onKeyUp="'.$fu.'" ';
  $html .= 'onKeyDown="'.$fu.'">'.htmlspecialchars($this->getValue($this->name.'text')).'</textarea><br/>'."\n";
  $html .= '               Zeichen:<input name="'.$this->name.'_anzahl" value="'.strlen($this->getValue($this->name.'text')).'" size="5"> (max 255)'."\n";
  $html .= '</div><!-- / type shortText -->'."\n";
  return $html;
 }

 function render_javascript () {
 }

}


